package hfjava;
import java.util.*;
public class Score_5 {
    public static void main(String[] args) {
        double score=0;
        double sum=0;
        double avgscore=0;
        Scanner input=new Scanner(System.in);
        for (int i = 1; i <4 ; i++) {
            System.out.println("请输入"+i+"班5名同学成绩");
            for (int j=1;j<=5;j++){
                System.out.println("请输入第"+j+"位同学成绩");
                score=input.nextDouble();
                if (score>=0&&score<100) {
                    sum += score;
                }else{
                    System.out.println("输入错误");
                    j--;
                }

            }
            avgscore=Math.round(sum/5*100)*0.01d;
            System.out.println(i+"班"+"平均成绩为"+avgscore);
            System.out.println(i+"班"+"总成绩为"+sum);
        }
    }

}
